package com.caochenlei.command;

public class Client {
    public static void main(String[] args) {
        //创建远程遥控器
        RemoteController remoteController = new RemoteController();
        //创建电视机接收者
        TVReceiver tvReceiver = new TVReceiver();
        TVOffCommand tvOffCommand = new TVOffCommand(tvReceiver);
        TVOnCommand tvOnCommand = new TVOnCommand(tvReceiver);
        remoteController.setCommand(0, tvOnCommand, tvOffCommand);
        //调用电视机的操作
        remoteController.onButtonWasPushed(0);
        remoteController.offButtonWasPushed(0);
        remoteController.undoButtonWasPushed();
    }
}
